package lagou.demo;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class JDBC02 {
    public static void main(String[] args) throws SQLException {

        Connection connection = DBUtils.getConnection();
        Statement statement = connection.createStatement();
        ResultSet resultSet = statement.executeQuery("select * from employee");
        while (resultSet.next()) {
            String name = resultSet.getString("name");
            System.out.println("员工的姓名: " + name);
        }
        resultSet.close();
        statement.close();
        connection.close();
    }
}
